/*
 * Copyright (C) 2009 M. Hautle.
 * 
 * This file is part of TrackedBean.
 * 
 * TrackedBean is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation, either version 3 of the License, or (at your option) any later version.
 * 
 * TrackedBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License along with TrackedBean. If not, see <http://www.gnu.org/licenses/>.
 */
package ch.trackedbean.validator;

/**
 * Interface for message interpolators.
 * 
 * @author M. Hautle
 */
public interface IInterpolator {
	/**
	 * Returns the message for the given key.
	 * 
	 * @param key The key
	 * @return The corresponding message
	 */
	String getMessage(String key);

	/**
	 * Looks up the message text and replaces all <code>${index}</code> elements.<br>
	 * The messages stored in the resource properties file may contain <code>${index}</code> place holders which were replaced by the passed values.
	 * 
	 * @param key The key of the resource message
	 * @param values The values to fill in the <code>${index}</code> placeholders
	 * @return The filled message.
	 */
	String getMessage(String key, Object[] values);
}
